home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Sound / AlgoMusic / Install < prev    next >
Text File  |  1997-12-03  |  15KB  |  412 lines

  1. ; AlgoMusic Install Utility
  2. ; (C) 1997 by Thomas Schürger
  3. ; REMEMBER THAT ALGOMUSIC IS >GIFTWARE<!!
  4.  
  5. ; $VER: AlgoMusicInstall 2.3 (03.12.97)
  6. ;
  7. ; Script will auto-detect 68020/030, 68040/060
  8. ; and also update/full install archive.
  9. ;
  10. ; If you find any problems in this script, please
  11. ; send me a bug-report including the line where
  12. ; the Installer is complaining!
  13.  
  14.  
  15. (set #minupdateversion "2.0")
  16.  
  17. ; Do not allow Novice User (when running from Shell)
  18.  
  19. (if (= @user-level 0)
  20.     (set @user-level 1)
  21. )
  22.  
  23. ; Get AlgoMusic version of the version present in install directory
  24.  
  25. (set #algoverlong (getversion "AlgoMusic.000"))
  26.  
  27. (if #algoverlong
  28.   (
  29.     (set #algoversion (/ #algoverlong 65536 ))
  30.     (set #algorevision (- #algoverlong (* #algoversion 65536 )))
  31.   )
  32.  
  33.   (
  34.     (set #algoversion "x")
  35.     (set #algorevision "x")
  36.   )
  37. )
  38.  
  39. (set #update (not (exists "Melody")))
  40.  
  41. (set #versionstring (cat #algoversion "." #algorevision))
  42.  
  43. ; Set texts to language (locale)
  44. ; Set to German if available, English otherwise
  45.  
  46. (if (not (patmatch "(68000|68010)" (database "cpu")))
  47.    (if (not (patmatch "(68020|68030)" (database "cpu")))
  48.      (
  49.      set #cputypenr "2"
  50.      )
  51.  
  52.      (
  53.      set #cputypenr "1"
  54.      )
  55.    )
  56.  
  57.    (
  58.    set #cputypenr "0"
  59.    )
  60. )
  61.  
  62. (if (= @language "deutsch")
  63.   (
  64.    (set #installerversion  "Sie haben eine veraltete Version des Installers installiert.\n\nDie neue Version unterstützt u.a. neue Features. Sie ist z.B. im Aminet erhältlich.\n\nBitte installieren Sie diese demnächst!")
  65.    (set #welcometext       (cat "Willkommen zum Installationsprogramm für AlgoMusic V" #versionstring ", dem ultimativen Programm für algorithmische Musik auf Ihrem Amiga.\n\nEinfache und intuitive Installation ist garantiert."))
  66.    (set #wrongosversion    "Sie benötigen mindestens Amiga OS 2.0 (V36) für AlgoMusic.\n\nBitte unterstützen Sie den Amiga und rüsten Sie auf das jeweils neueste Betriebssystem auf.\n\nEs ist dringendst anzuraten und lohnt sich!")
  67.    (set #algomusicexists   "Sie haben im angegebenen Pfad AlgoMusic bereits installiert. Soll dieses Verzeichnis in \"AlgoMusic.old\" umbenannt werden und AlgoMusic ins angegebene Verzeichnis installiert werden oder möchten Sie die vorhandene Version überschreiben (dabei gehen auch alle Samples usw. verloren)?")
  68.    (set #cpuversion        "Welche Prozessorversion von AlgoMusic möchten Sie installieren?")
  69.    (set #existsrename      "Umbenennen")
  70.    (set #existsoverwrite   "Überschreiben")
  71.    (set #destinationprompt (cat "Wählen Sie das Verzeichnis, in das AlgoMusic %s installiert werden soll. Ein neues Verzeichnis namens \"AlgoMusic\" wird dort erstellt."))
  72.    (set #destinationupdateprompt (cat "Wählen Sie das Verzeichnis, in dem das AlgoMusic-Verzeichnis bereits installiert ist. Mindestens Version " #minupdateversion " muß dort vorhanden sein.\n\nEs werden dort nur die benötigten Files upgedatet."))
  73.    (set #installicons      "Welche Arten von Icons sollen für AlgoMusic verwendet werden?")
  74.    (set #copyingtext       "Kopiere benötigte Dateien in das Verzeichnis\n\n\"%s\"")
  75.    (set #prefsrenamed      "Sie hatten bereits Voreinstellungen für AlgoMusic in Ihrem ENVARC: Verzeichnis. \"AlgoMusic.prefs\" wurde dort in \"AlgoMusic.prefs.old\" umbenannt.\n\nVergleichen Sie am besten nach durchgeführter Installation beide Files und sehen Sie nach, was Sie in die neuen Prefs übernehmen möchten.")
  76.    (set #seehistoryprompt  "Möchten Sie sich das History-File von AlgoMusic ansehen?")
  77.    (set #seehistoryhelp    "AlgoMusic hat bei jeder neuen Version eine Reihe von neuen Features und Bugfixes. Lesen Sie sich am besten durch, was bei dieser Version verbessert und ergänzt wurde.")
  78.    (set #addpathprompt     "Das AlgoMusic-Verzeichnis sollte in den Systempfad mit aufgenommen werden. Soll dies automatisch in der User-Startup für Sie erledigt werden oder wollen Sie es selber durchführen?")
  79.    (set #userstartup       "Die folgenden Zeilen werden an Ihre User-Startup angehängt:\n\n")
  80.    (set #userstartupauto   "Automatisch")
  81.    (set #userstartupmanu   "Selber")
  82.    (set #installdeveloper  "Möchten Sie die Entwickler-Dateien für AlgoMusic installieren?\n\nFür den normalen Gebrauch werden sie nicht benötigt, für Programmierer existiert jedoch ein interessantes Interface, um z.B. Analyzer oder ähnliches zu programmieren.")
  83.    (set #giftware          "Bitte denken Sie daran, daß AlgoMusic GIFTWARE ist\n(die meisten Benutzer scheinen dies zu vergessen).\n\nSie müssen bei Gefallen dem Autor ein kleines Geschenk schicken. Lesen Sie dazu auch im Guide nach!\n\n\n\nViel Spaß,\n\nThomas Schürger.")
  84.    (set #delold            "AlgoMusic ist installiert. Wenn Sie von der neuen Version überzeugt sind, können Sie nach kurzer Zeit das Verzeichnis \"%s\" löschen.")
  85.   )
  86.  
  87.   ( 
  88.    (set #installerversion  "You've got an old version of the Installer installed.\n\nThe new version has lots of new features and improvements. It's available on Aminet, for example.\n\nPlease install it as soon as possible!")
  89.    (set #welcometext       (cat "Welcome to the installation utility for AlgoMusic V" #versionstring ", the ultimate program for algorithmic music on your Amiga.\n\nEasy and intuitive installation is guaranteed."))
  90.    (set #wrongosversion    "AlgoMusic requires at least Amiga OS 2.0 (V36).\n\nPlease support your beloved computer by installing the newest Amiga operating system available.\n\nIt's worth it for sure!")
  91.    (set #algomusicexists   "You've already got AlgoMusic installed in the path specified. Would you like to rename the existing directory to \"AlgoMusic.old\" and install the new version or would you like to overwrite the old version (all samples etc. will be lost)?")
  92.    (set #cpuversion        "Which CPU version of AlgoMusic would you like to install?")
  93.    (set #existsrename      "Rename")
  94.    (set #existsoverwrite   "Overwrite")
  95.    (set #destinationprompt "Select a destination for AlgoMusic %s. A new drawer called \"AlgoMusic\" will be created there.")
  96.    (set #installicons      "Which type of icons should be installed for AlgoMusic?")
  97.    (set #destinationupdateprompt (cat "Select the directory where the AlgoMusic directory has already been installed. At least V" #minupdateversion " must be present there.\n\nOnly the required files will be updated."))
  98.    (set #copyingtext       "Copying required files to:\n\n\"%s\"")
  99.    (set #prefsrenamed      "You already had preferences for AlgoMusic in your ENVARC: directory. \"AlgoMusic.prefs\" has been renamed to \"AlgoMusic.prefs.old\".\n\nPlease compare both files and decide which of the old preferences you would like to transfer to the new prefs-file after the installation has been completed.")
  100.    (set #seehistoryprompt  "Would you like to see the history of AlgoMusic?")
  101.    (set #seehistoryhelp    "AlgoMusic has a lot of new features and bugfixes with each version. You may want to see what has been changed and improved in this version.")
  102.    (set #addpathprompt     "You should include the AlgoMusic-directory in your system path. Would you like this to be done automatically or would you like to do it by hand?")
  103.    (set #userstartup       "The following lines will be appended to your user-startup:\n\n")
  104.    (set #userstartupauto   "Automatically")
  105.    (set #userstartupmanu   "By hand")
  106.    (set #installdeveloper  "Would you like to install the developer files for AlgoMusic?\n\nThey are not required for normal use, there is an interesting interface for developers to program analyzers etc., however.")
  107.    (set #giftware          "Remember that AlgoMusic is GIFTWARE\n(most people seem to forget that).\n\nYou are asked to send me a gift if you like this program. Read the guide for further information!\n\n\n\nHave fun!\n\nThomas Schürger")
  108.    (set #delold            "AlgoMusic is now installed. If you are convinced by the new version, you can delete the directory \"%s\" after a while.")
  109.   )
  110. )
  111.  
  112. ; Welcome the user
  113.  
  114. (welcome #welcometext)
  115.  
  116. ; Get Amiga OS version
  117.  
  118. (set #osversion (/ (getversion "exec.library" (resident)) 65536 ))
  119.  
  120. (if (< #osversion 36 )
  121.   (exit #wrongosversion (quiet))
  122. )
  123.  
  124. ; Remind user if having installed an old Installer
  125.  
  126. (if (= @installer-version "")
  127.   (message #installerversion)
  128. )
  129.  
  130. (set #cputypenr
  131.    (askchoice
  132.       (help @askdir-help)
  133.       (choices "68000" "68020/030" "68040/060")
  134.       (default #cputypenr)
  135.       (prompt #cpuversion)
  136.    )
  137. )
  138.  
  139. (if (= #cputypenr "0")
  140.    (set #cputype "68000")
  141.    
  142.    (if (= #cputypenr "1")
  143.       (set #cputype "68020/030")
  144.       (set #cputype "68040/060")
  145.    )
  146. )
  147.  
  148. (complete 5)
  149.  
  150. ; Select appropriate destination directory
  151.  
  152. (run "which AlgoMusic >env:AlgoMusic.temp")
  153. (set #contents (getenv "AlgoMusic.temp"))
  154.  
  155. (set #destdir (askdir
  156.                  (prompt (if #update #destinationupdateprompt (#destinationprompt #cputype)))
  157.                  (default 
  158.                     (if (strlen #contents)
  159.                        (pathonly (pathonly #contents))
  160.                        (expandpath (if (exists "AlgoMusic:" (noreq))
  161.                                            "AlgoMusic:/"
  162.                                       (if (exists "Music:" (noreq))
  163.                                            "Music:"
  164.                                       (if (exists "Sound:" (noreq))
  165.                                            "Sound:"
  166.                                       (if (exists "Work:" (noreq))
  167.                                            "Work:" "SYS:"
  168.                                       )))))
  169.                     )
  170.                  (newpath)
  171.                  (help @askdir-help)
  172.             )
  173.          )
  174. )
  175.  
  176. (set #fulldestdir (tackon #destdir "AlgoMusic"))
  177. (set #fullolddir  (tackon #destdir "AlgoMusic.old"))
  178. (set @default-dest #fulldestdir)
  179.  
  180. (complete 10)
  181.  
  182. (set renamed 0)
  183.  
  184. ; Check if AlgoMusic already exists in selected directory
  185.  
  186. (if (not #update)
  187.   (
  188.    (if (exists #fulldestdir)
  189.       (
  190.          (if (askbool
  191.                 (prompt #algomusicexists)
  192.                 (default 1)
  193.                 (choices #existsrename #existsoverwrite)
  194.                 (help @askbool-help)
  195.              )
  196.  
  197.              (
  198.                 (run (cat "Delete " #fullolddir " ALL QUIET"))
  199.                 (rename #fulldestdir #fullolddir)
  200.                 (set #renamed 1)
  201.              )
  202.              (
  203.                 (run (cat "Delete " #fulldestdir " ALL QUIET"))
  204.                 (run (cat "Delete " #fullolddir " ALL QUIET"))
  205.              )
  206.           )
  207.        )
  208.    (makedir #fulldestdir (infos))
  209.    )
  210.   )
  211. )
  212.  
  213. (complete 20)
  214.  
  215. (set #developer (askbool
  216.        (prompt #installdeveloper)
  217.        (default 1)
  218.        (help @askbool-help))
  219. )
  220.  
  221. (complete 25)
  222.  
  223. (set #iconset (askchoice
  224.        (prompt #installicons)
  225.        (default 1)
  226.        (help @askchoice-help)
  227.        (choices "Normal WB (4 colors)" "MagicWB   (8 colors)" "NewIcons  (16 colors)"))
  228. )
  229.  
  230. (complete 30)
  231.  
  232. (working (#copyingtext #fulldestdir))
  233.  
  234. (copyfiles
  235.    (source "")
  236.    (dest #fulldestdir)   
  237.    (all)
  238.    (optional (nogauge))
  239. )
  240.  
  241. (complete 80)
  242.  
  243. ; Check if AlgoMusic preferences already exist
  244.  
  245. (if (exists "ENVARC:AlgoMusic.prefs"))
  246.    (
  247.    (delete "ENVARC:AlgoMusic.prefs.old")
  248.    (rename "ENVARC:AlgoMusic.prefs" "ENVARC:AlgoMusic.prefs.old")
  249.    (message #prefsrenamed)
  250.    )
  251.  
  252. (copyfiles
  253.    (source "AlgoMusic.prefs")
  254.    (dest "ENVARC:")
  255.    (nogauge)
  256. )
  257.  
  258. (if (exists "ENV:AlgoMusic.prefs"))
  259.    (
  260.    (delete "ENV:AlgoMusic.prefs.old")
  261.    (rename "ENV:AlgoMusic.prefs" "ENV:AlgoMusic.prefs.old")
  262.    )
  263.  
  264. (copyfiles
  265.    (source "AlgoMusic.prefs")
  266.    (dest "ENV:")
  267.    (nogauge)
  268. )
  269.  
  270. (delete (tackon #fulldestdir "Install"))
  271. (delete (tackon #fulldestdir "Install.info"))
  272. (delete (tackon #fulldestdir "AlgoMusic.prefs"))
  273.  
  274. (if #update
  275.   (
  276.     (delete (tackon #fulldestdir "AlgoMusic"))
  277.     (delete (tackon #fulldestdir "AlgoMusicPrefs.info"))
  278.     (delete (tackon #fulldestdir "AlgoMusic.info"))
  279.   )
  280. )
  281.  
  282. (if (= #cputype "68020/030")
  283.    (
  284.    (delete (tackon #fulldestdir "AlgoMusic.000"))
  285.    (delete (tackon #fulldestdir "AlgoMusic.040"))
  286.    (rename (tackon #fulldestdir "AlgoMusic.020") (tackon #fulldestdir "AlgoMusic"))
  287.    )
  288.  
  289.   (if (= #cputype "68040/060")
  290.      (
  291.      (delete (tackon #fulldestdir "AlgoMusic.000"))
  292.      (delete (tackon #fulldestdir "AlgoMusic.020"))
  293.      (rename (tackon #fulldestdir "AlgoMusic.040") (tackon #fulldestdir "AlgoMusic"))
  294.      )
  295.  
  296.      (
  297.      (delete (tackon #fulldestdir "AlgoMusic.020"))
  298.      (delete (tackon #fulldestdir "AlgoMusic.040"))
  299.      (rename (tackon #fulldestdir "AlgoMusic.000") (tackon #fulldestdir "AlgoMusic"))
  300.      )
  301.   )
  302. )
  303.  
  304. (if (not #developer)
  305.    (
  306.       (delete (tackon #fulldestdir "Developer") (all))
  307.    )
  308. )
  309.  
  310. (delete (tackon #fulldestdir "AlgoMusic.info"))
  311. (delete (tackon #fulldestdir "AlgoMusicPrefs.info"))
  312.  
  313. (if (= #iconset 0)
  314.    (
  315.    (rename (tackon #fulldestdir "icons/AlgoMusicRegular.info") (tackon #fulldestdir "AlgoMusic.info"))
  316.    (rename (tackon #fulldestdir "icons/AlgoMusicPrefsRegular.info") (tackon #fulldestdir "AlgoMusicPrefs.info"))
  317.    )
  318.  
  319.    (if (= #iconset 1)
  320.       (
  321.       (rename (tackon #fulldestdir "icons/AlgoMusicMagicWB.info") (tackon #fulldestdir "AlgoMusic.info"))
  322.       (rename (tackon #fulldestdir "icons/AlgoMusicPrefsMagicWB.info") (tackon #fulldestdir "AlgoMusicPrefs.info"))
  323.       )
  324.  
  325.       (
  326.       (rename (tackon #fulldestdir "icons/AlgoMusicNewIcons.info") (tackon #fulldestdir "AlgoMusic.info"))
  327.       (rename (tackon #fulldestdir "icons/AlgoMusicPrefsNewIcons.info") (tackon #fulldestdir "AlgoMusicPrefs.info"))
  328.       )
  329.    )   
  330. )
  331.  
  332. (delete (tackon #fulldestdir "icons") (all))
  333.  
  334.  
  335. (set #uschanges (cat "Path \"" #fulldestdir "\" ADD"))
  336.  
  337. (complete 85)
  338.  
  339. ; Ask if user wants to automatically set system path to AlgoMusic or not
  340.  
  341. (if (not #update)
  342.    (
  343.  
  344.       (if (askbool
  345.              (prompt #addpathprompt)
  346.             (default 1)
  347.             (help @askbool-help)
  348.             (choices #userstartupauto #userstartupmanu)
  349.           )
  350.  
  351.           (
  352.              (startup "AlgoMusic"
  353.                 (command #uschanges)
  354.                 (prompt (cat #userstartup ";BEGIN AlgoMusic\n" #uschanges "\n;END AlgoMusic"))
  355.                 (help @startup-help)
  356.              )
  357.           )
  358.       )       
  359.  
  360.       (complete 90)
  361.  
  362.       (if #renamed
  363.          (message (#delold #fullolddir))
  364.       )
  365.    )
  366. )
  367.  
  368. (complete 95)
  369.  
  370. ; Ask if user wants to see the history guide of AlgoMusic
  371.  
  372. (run "which AmigaGuide >env:AlgoMusic.temp")
  373. (set #contents (getenv "AlgoMusic.temp"))
  374. (delete "env:AlgoMusic.temp")
  375.  
  376. (if (strlen #contents)
  377.   (
  378.     (set #contents (substr #contents 0 (- (strlen #contents) 1 ) ) )
  379.     (if (askbool
  380.            (default 1)
  381.            (prompt #seehistoryprompt)
  382.            (help #seehistoryhelp)
  383.         )
  384.         (run (cat #contents " AlgoMusic.guide DOC History"))
  385.     )
  386.   )
  387.   
  388.   (
  389.     (run "which Multiview >env:AlgoMusic.temp")
  390.     (set #contents (getenv "AlgoMusic.temp"))
  391.  
  392.     (if (strlen #contents)
  393.       (
  394.         (set #contents (substr #contents 0 (- (strlen #contents) 1 ) ) )
  395.         (if (askbool
  396.                (default 1)
  397.                (prompt #seehistoryprompt)
  398.                (help #seehistoryhelp)
  399.             )
  400.             (run (cat #contents " AlgoMusic.guide"))
  401.         )
  402.       )
  403.     )
  404.   )
  405. )
  406.  
  407. (complete 100)
  408.  
  409. ; Present the cute Giftware message
  410.  
  411. (message #giftware)
  412.